#ifndef _WIN_NETW_H_
#define _WIN_NETW_H_

#include <winsock.h>

typedef in_addr TNetAddr;

typedef struct
{
	int port;
	SOCKET socket;
	in_addr address;
}TNetLink;

TNetLink *net_startUDP(int port);
bool net_stopUDP(TNetLink *lnk);
bool net_sendUDP(TNetLink *lnk, TNetAddr *addr, void *buf, int len);
int net_recvUDP(TNetLink *lnk, TNetAddr *addr, void *buf, int len);
void net_getAddrStr(TNetAddr *addr, char *buf);
void net_getAddrFromStr(TNetAddr *addr, char *buf);


#endif //_WIN_NETW_H_